/*
Copyright 2014, KISSY v1.47
MIT Licensed
build time: Aug 18 16:35
*/
KISSY.add("anim/transition",["dom","./base"],function(k,n,x,q){function r(a,c){return c.toUpperCase()}function o(a){-1!==a.indexOf("-")&&(a=a.replace(s,r));if(a in g)return g[a];if(!m||a in m)g[a]={propertyName:a,propertyNamePrefix:""};else{for(var c=a.charAt(0).toUpperCase()+a.slice(1),d,b=0;b<t;b++){var e=p[b];d=e+c;d in m&&(g[a]={propertyName:d,propertyNamePrefix:e})}g[a]=g[a]||null}return g[a]}function u(a){var c="";h.each(a,function(a,b){c&&(c+=",");c+=b+" "+a.duration+"s "+a.easing+" "+a.delay+
"s"});return c}function v(a){return a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()})}function i(a,c,d,b,e){if(!(this instanceof i))return new i(a,c,d,b,e);i.superclass.constructor.apply(this,arguments)}var s=/-([a-z])/ig,p=["Webkit","Moz","O","ms"],t=p.length,g={},m=document.documentElement.style,h=k,j=n("dom"),k=n("./base"),l=o("transition").propertyName,w={ease:1,linear:1,"ease-in":1,"ease-out":1,"ease-in-out":1};h.extend(i,k,{prepareFx:function(){var a=this._propsData,c={},d,b;for(b in a)d=
a[b],"string"===typeof d.easing?!h.startsWith(d.easing,"cubic-bezier")&&!w[d.easing]&&(d.easing="linear"):d.easing="linear",(d=o(b))&&(c[v(d.propertyName)]=a[b]);this._propsData=c},doStart:function(){var a=this,c=a.node,d=c.style,b=a._propsData,e=d[l],f=0,g={};h.each(b,function(a,b){var d=a.value;j.css(c,b,j.css(c,b));g[b]=d;f=Math.max(a.duration+a.delay,f)});-1!==e.indexOf("none")?e="":e&&(e+=",");d[l]=e+u(b);setTimeout(function(){j.css(c,g)},0);a._transitionEndTimer=setTimeout(function(){a.stop(!0)},
1E3*f)},beforeResume:function(){var a=this._propsData,c=h.merge(a),d=this._runTime/1E3;h.each(c,function(b,c){var f=d;b.delay>=f?b.delay-=f:(f-=b.delay,b.delay=0,b.duration>=f?b.duration-=f:delete a[c])})},doStop:function(a){var c=this.node,d=c.style,b=this._propsData,e=[],f={};this._transitionEndTimer&&(clearTimeout(this._transitionEndTimer),this._transitionEndTimer=null);h.each(b,function(b,d){a||(f[d]=j.css(c,d));e.push(d)});b=h.trim(d[l].replace(RegExp("(^|,)\\s*(?:"+e.join("|")+")\\s+[^,]+",
"gi"),"$1")).replace(/^,|,,|,$/g,"")||"none";d[l]=b;j.css(c,f)}});h.mix(i,k.Statics);q.exports=i});
